
<div class="flat_area grid_16">
    <h2>Report Peringkat</h2>
</div>

<div class="search-form">
    <div class="form">

    </div>
</div>
<?php
$this->widget('zii.widgets.grid.CGridView', array(
    //'id'=>'sys-ewallet-withdrawal-grid',
    'dataProvider' => $dataProvider,
    //'filter'=>$model,
    'columns' => array(
//        array('header' => '#',
//              'type' => 'raw',
//              'value' => 'CHtml::checkBox("withdraw[]", false, array("value" => $data["board_id"]));',
//              'htmlOptions' => array('style' => 'text-align:center;')),
        array('header' => 'No.',
            'value' => '$this->grid->dataProvider->pagination->currentPage * $this->grid->dataProvider->pagination->pageSize + ($row+1)."."',
            'htmlOptions' => array('style' => 'text-align:center;'),
        ),
        array(
            'header' => 'ID Member',
            'name' => 'network_mid',
            'value' => '$data["network_mid"]',
            'htmlOptions' => array('style' => 'text-align:center;'),
        ),
        array('header' => 'Nama',
            'name' => 'member_name',
            'value' => '$data["member_name"]',
            'htmlOptions' => array('style' => 'text-align:center;'),
        ),
        array('header' => 'Peringkat',
            'name' => 'leadership_level_log_name',
            'value' => '$data["leadership_level_log_name"]',
            'htmlOptions' => array('style' => 'text-align:center;'),
        ),
        array('header' => 'Tanggal Kualifikasi',
            'name' => 'leadership_level_log_periode',
            //'value' => 'function_lib::convert_date($data["leadership_level_log_periode"],"text")',
            'value' => '$data["leadership_level_log_periode"]',
            'htmlOptions' => array('style' => 'text-align:center;'),
        ),
        array(
            'header' => 'Action',
            'class' => 'CButtonColumn',
            'template' => '{report}',
            'buttons' => array(
                
                'report' => array(
                    'imageUrl' => Yii::app()->request->baseUrl . '/images/icon/adm_edit2_navy.png',
                    'type' => 'raw',
                    'click' => 'function() {
                            var member_network_id = $(this).parent().parent().children(":nth-child(2)").text();
                            var tanggal = $(this).parent().parent().children(":nth-child(5)").text();
                            $("#div_content").load("report/"+member_network_id+"/"+tanggal+"");
                            $("#dialog").dialog( "option", "width", 800 );
                            $("#dialog").dialog( "option", "height", 500 );
                            $("#dialog").dialog("open");
                            
                        }',
                ),
            ),
        ),
    ),
    'pager' => array(
        'cssFile' => Yii::app()->params['backendUrl'] . '/css/style-pager.css',
        'header' => '',
        'firstPageLabel' => 'First',
        'prevPageLabel' => 'Previous',
        'nextPageLabel' => 'Next',
        'lastPageLabel' => 'Last',
    ),
    // 'selectableRows' => 2,
    // 'selectionChanged' => 'userClicks',
    'cssFile' => Yii::app()->params['backendUrl'] . '/css/style-gridview.css',
));
?>
<!--<div style="border-top:1px solid silver; border-bottom:1px solid silver; background: #EEEEEE; padding:10px;">
<?php
$xls_icon = Yii::app()->baseUrl . '/images/report_icon/excel.png';
echo CHtml::form('', 'POST');
echo CHtml::imageButton($xls_icon, array('alt' => 'Excel', 'title' => 'Download in Excel', 'name' => 'button[xls]', 'value' => 'xls'));
echo CHtml::endForm();
?>
</div>-->
<script>
    var id = 0;
    var row = 0;
    function userClicks(target_id) {
        id = $.fn.yiiGridView.getSelection(target_id);
        //id = $.fn.yiiGridView.getKey(target_id, 2);
        //alert(id);
    }
    
    function clickReport(target_id) {
        id = $.fn.yiiGridView.getSelection(target_id);
        alert(id);
        return false;
    }
</script>

<div id="dialog" style="text-align: left;display: none; ">
    <div class="box grid_16">
        <a href="#" class="grabber">&nbsp;</a>
        <a href="#" class="toggle">&nbsp;</a>
        <div class="toggle_container">
            <div class="wizard">		
                
            </div>
            <div id="div_content" class="block grid_16 alpha omega wizard_content">

            </div>
        </div>
    </div>
    <script type="text/javascript">
	
        // wizard
        $('.wizard_steps ul li a').click(function(){
	
            $('.wizard_steps ul li').removeClass('current');
            $(this).parent('li').addClass('current');
		
            var step = $(this).attr('href');
            var step_num = $(this).attr('href').replace('#step_','');
            var step_multiplyby = (100 / $(".wizard_steps > ul > li").size());
            var prog_val = (step_num*step_multiplyby);
		
            $( "#progressbar").progressbar({ value: prog_val });
		
            $('.wizard_content').children().hide();
            $('.wizard_content').children(step).fadeIn();
		
            return false;
        });
	
        $('button.next_step').click(function(){
		
            var step = $(this).attr('id');
            var hash_step = ('#'+step);
				
            var step_num = $(this).attr('id').replace('step_','');
            var step_multiplyby = (100 / $(".wizard_steps > ul > li").size());
            var prog_val = (step_num*step_multiplyby);
		
            $( "#progressbar").progressbar({ value: prog_val });
		
            $('.wizard_steps ul li').removeClass('current');
            $('a[href='+ hash_step +']').parent().addClass('current');
		
            $('.wizard_content').children().hide();
            $('.wizard_content').children(hash_step).fadeIn();
		
            return false;		
        });
	

    </script>

</div>


